# Function for building single example


file(GLOB _SOURCE *.h
    ${CMAKE_CURRENT_SOURCE_DIR}/utils/*.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)

if(MSVC)
    include(version/generate_product_version.cmake)
    generate_product_version(
        VersionFilesOutputVariable
        NAME ${CODE_NAME}
        VERSION_MAJOR 1
        VERSION_MINOR 0
        VERSION_PATCH 0
        VERSION_REVISION 0
        COMPANY_NAME "host"
        COMPANY_COPYRIGHT "Copyright (C) 2023"
        FILE_DESCRIPTION  "test"
    )
endif()
    # add_library(${CODE_NAME} SHARED ${_SOURCE} ${VersionFilesOutputVariable})
    add_executable(${CODE_NAME} ${_SOURCE} ${VersionFilesOutputVariable})
if(CMAKE_HOST_UNIX)
    SET_TARGET_PROPERTIES(${CODE_NAME} PROPERTIES VERSION 1.0.0.0 SOVERSION 1)
endif()

set_target_properties (${CODE_NAME} PROPERTIES DEBUG_POSTFIX d)
target_link_libraries(${CODE_NAME}
    external::sqlite3 
    external::doctest
    external::ormpp
    external::spdlog
)

target_include_directories(${CODE_NAME} PRIVATE ${SPDLOG_ALL_HEADERS})